package bean;

import java.util.concurrent.atomic.AtomicInteger;

public class RequestWrapper {
    private static final AtomicInteger incId = new AtomicInteger(0);
    private byte[] targetInstanceName;
    private byte[] methodName;
    private byte[][] argTypes;
    private Object[] requestObjects;
    private Object message;
    private int timeout;
    private int id;
    private int protocolType;
    private int codecType;
    private int messageLen;
    public RequestWrapper(Object message,int timeout,int codecType,int protocolType){
        this(message,timeout,incId.incrementAndGet(),codecType,protocolType);
    }

    public RequestWrapper(Object message,int timeout,int id,int codecType,int protocolType){
        this.message = message;
        this.id = id;
        this.timeout = timeout;
        this.codecType = codecType;
        this.protocolType = protocolType;
    }
    public RequestWrapper(byte[] targetInstanceName, byte[] methodName, byte[][] argTypes,
                          Object[] requestObjects, int timeout, int codecType, int protocolType) {
        this(targetInstanceName, methodName, argTypes, requestObjects, timeout, incId.incrementAndGet(), codecType, protocolType);
    }

    public RequestWrapper(byte[] targetInstanceName, byte[] methodName, byte[][] argTypes,
                          Object[] requestObjects, int timeout, int id, int codecType, int protocolType) {
        this.requestObjects = requestObjects;
        this.id = id;
        this.timeout = timeout;
        this.targetInstanceName = targetInstanceName;
        this.methodName = methodName;
        this.argTypes = argTypes;
        this.codecType = codecType;
        this.protocolType = protocolType;
    }


    public byte[] getTargetInstanceName() {
        return targetInstanceName;
    }

    public void setTargetInstanceName(byte[] targetInstanceName) {
        this.targetInstanceName = targetInstanceName;
    }

    public byte[] getMethodName() {
        return methodName;
    }

    public void setMethodName(byte[] methodName) {
        this.methodName = methodName;
    }

    public byte[][] getArgTypes() {
        return argTypes;
    }

    public void setArgTypes(byte[][] argTypes) {
        this.argTypes = argTypes;
    }

    public Object[] getRequestObjects() {
        return requestObjects;
    }

    public void setRequestObjects(Object[] requestObjects) {
        this.requestObjects = requestObjects;
    }

    public Object getMessage() {
        return message;
    }

    public void setMessage(Object message) {
        this.message = message;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProtocolType() {
        return protocolType;
    }

    public void setProtocolType(int protocolType) {
        this.protocolType = protocolType;
    }

    public int getCodecType() {
        return codecType;
    }

    public void setCodecType(int codecType) {
        this.codecType = codecType;
    }

    public int getMessageLen() {
        return messageLen;
    }

    public void setMessageLen(int messageLen) {
        this.messageLen = messageLen;
    }
}
